﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void imgbtnOk_Click(object sender, ImageClickEventArgs e)
    {
        CAdmin admin = new CAdmin();
        string id = admin.Login(this.tbName.Text, this.tbPwd.Text);
        if (null != id)
        {
            Session["userid"] = id;
            System.Web.Security.FormsAuthentication.RedirectFromLoginPage(this.tbName.Text, false);
        }
        else
        {
            Session["userid"] = null;
            ScriptManager.RegisterClientScriptBlock(Page, upLogin.GetType(), "", "alert('用户名或密码错误，请重新输入！');", true);
            this.tbPwd.Focus();
            this.upLogin.Update();
        }
    }
}